﻿{include file="../../common/view/m_header" /}
<!-- 中间区域 -->
<div class="center">
    <div class="in_box">
        <div class="w1200">
            <div class="product-box">
                <div class="product-bti">需要支付：¥ {$payAmount} &nbsp;&nbsp;&nbsp;&nbsp;订单号：{$orderCn}</div>
                <div style="display: block;float: none;text-align: center;font-size: 16px;">
                    {if $payId == 1}
                    支付二维码：<br>
                    {$qrcode|raw}<br><br>
                    {/if}
                    订单信息：{$order_info}<br>
                    <a href="{:url('Member/order_details')}?order_no={$orderCn}"  style="display: block;font-size: 16px;color: #ff0000;">订单详情</a>
                </div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<input type="hidden" name="out_trade_no" id="out_trade_no" value="{$orderCn}" />
{if $payId == 1}
<script>
    $(function(){
        setInterval(function(){check()}, 1000);  //1秒查询一次支付是否成功
    })
    function check(){
        var url = "/wxpay/orderquery.php";　　//新建
        var out_trade_no = $("#out_trade_no").val();
        var param = {'out_trade_no':out_trade_no};
        $.post(url, param, function(data){
            data = JSON.parse(data);
            console.log(data);
            if(data['trade_state'] == "SUCCESS"){
                layer.msg("订单支付成功，即将跳转处理", {
                    icon: 6,
                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                }, function () {
                    //跳转页面
                    window.location.href = "/index/Flow/wxpay_return?time_end="+data['time_end']+"&total_fee="+data['total_fee']+"&out_trade_no="+data['out_trade_no']+"&transaction_id="+data['transaction_id'];
                });
            }else{
                console.log(data);
            }
        });
    }
</script>
{/if}
<!-- 中间区域结束 -->
{include file="../../common/view/Footer" /}